package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.DataTypeInfoEnum;
import com.frogs.system.util.OpenPlatformEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

public class UserPersonalPraiseListRequest extends Request{

	/**
	 * 账号ID
	 */
	private int userId;
	
	private int pageNo;
	
	private int pageSize;
	
	private int openPlatformId;
	
	private int type;
	
	private int dataId;
	
	/** */
	public UserPersonalPraiseListRequest() {
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), 0);
		this.pageNo = requestInfo.getIntParameter(ApiUrlParamEnum.pageNo.getParamName(), 1);
		this.pageSize = requestInfo.getIntParameter(ApiUrlParamEnum.pageSize.getParamName(), 20);
		this.openPlatformId = requestInfo.getIntParameter(ApiUrlParamEnum.openPlatformId.getParamName(), OpenPlatformEnum.WECHAT_HDC.getId());
		this.type = requestInfo.getIntParameter(ApiUrlParamEnum.type.getParamName(), DataTypeInfoEnum.BLOOD_GLUCOSE.getId());
		this.dataId = requestInfo.getIntParameter(ApiUrlParamEnum.dataId.getParamName(), 0);
		if ( userId < 1 ) {
			throw new RequestIllegalException("error userId: " + userId);
		}
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getOpenPlatformId() {
		return openPlatformId;
	}

	public void setOpenPlatformId(int openPlatformId) {
		this.openPlatformId = openPlatformId;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getDataId() {
		return dataId;
	}

	public void setDataId(int dataId) {
		this.dataId = dataId;
	}

}
